package com.xiaobai.controller;

import com.xiaobai.product.bean.Product;
import com.xiaobai.service.ProductService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//@RequestMapping("/api/product/")
@RestController
public class ProductController {
    private final ProductService productService;

    public ProductController(ProductService productService) {
        this.productService = productService;
    }
    @GetMapping("/product/{id}")
    public Product getProduct(@PathVariable("id")Long productId){
       return productService.selectProductByBid(productId);
    }
}
